<!DOCTYPE html>
<html lang=en>
<head>
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="遇到一个实际应用：做的网站静态内容居多，但是多语言支持，网站的开发已经结束，是将语言存入客户端cookie中，然后通过cookie值获取对应资源文件。 现在需要对网站增加缓存。在asp.net 框架下,当然是首选 OutputCache。OutputCache是将客户端缓存以及服务端缓存进行统一管理，通过不同的策略设置。由于语言的更换不会修改URL，所以是无法使用浏览器缓存了（这里想起g">
<meta property="og:type" content="article">
<meta property="og:title" content="asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET">
<meta property="og:url" content="http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/index.html">
<meta property="og:site_name" content="TmoonSite">
<meta property="og:description" content="遇到一个实际应用：做的网站静态内容居多，但是多语言支持，网站的开发已经结束，是将语言存入客户端cookie中，然后通过cookie值获取对应资源文件。 现在需要对网站增加缓存。在asp.net 框架下,当然是首选 OutputCache。OutputCache是将客户端缓存以及服务端缓存进行统一管理，通过不同的策略设置。由于语言的更换不会修改URL，所以是无法使用浏览器缓存了（这里想起g">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2016-05-05T12:11:59.000Z">
<meta property="article:modified_time" content="2020-01-07T10:48:14.899Z">
<meta property="article:author" content="Tmoonlight">
<meta name="twitter:card" content="summary">
    
    
        
          
              <link rel="shortcut icon" href="/images/favicon.ico">
          
        
        
          
            <link rel="icon" type="image/png" href="/images/logo2.gif" sizes="192x192">
          
        
        
          
            <link rel="apple-touch-icon" sizes="180x180" href="/images/logo2.gif">
          
        
    
    <!-- title -->
    <title>asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET</title>
    <!-- styles -->
    
<link rel="stylesheet" href="/css/style.css">

    <!-- persian styles -->
    
      
<link rel="stylesheet" href="/css/rtl.css">

    
    <!-- rss -->
    
    
<meta name="generator" content="Hexo 4.2.0"></head>

<body class="max-width mx-auto px3 ltr">
    
      <div id="header-post">
  <a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fas fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        <li><a class="icon" href="/2016/05/09/CSC%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%9C%B0%E5%9D%80/"><i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i></a></li>
        
        
        <li><a class="icon" href="/2016/05/03/OutputCache%E7%BC%93%E5%AD%98%E4%BC%98%E5%8C%96asp.net%E4%BB%A3%E7%A0%81%E6%8F%90%E9%AB%98%E7%BD%91%E9%A1%B5%E6%80%A7%E8%83%BD%E4%BD%9C%E8%80%85/"><i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" href="#"><i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">Previous post</span>
      <span id="i-next" class="info" style="display:none;">Next post</span>
      <span id="i-top" class="info" style="display:none;">Back to top</span>
      <span id="i-share" class="info" style="display:none;">Share post</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/" target="_blank" rel="noopener"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&text=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&is_video=false&description=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET&body=Check out this article: http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/"><i class="fas fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&name=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&t=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-hacker-news " aria-hidden="true"></i></a></li>
</ul>

    </div>
    <div id="toc">
      
    </div>
  </span>
</div>

    
    <div class="content index py4">
        
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle" itemprop="name headline">
        asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET
    </h1>



    <div class="meta">
      <span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span itemprop="name">TmoonSite</span>
      </span>
      
    <div class="postdate">
      
        <time datetime="2016-05-05T12:11:59.000Z" itemprop="datePublished">2016-05-05</time>
        
      
    </div>


      

      

    </div>
  </header>
  

  <div class="content" itemprop="articleBody">
    <p><a href="http://www.csdn.net/?ref=toolbar" target="_blank" rel="noopener"></a></p>
<p><a href="http://blog.csdn.net/?ref=toolbar_logo" target="_blank" rel="noopener"></a></p>
<ul>
<li></li>
</ul>
<p>遇到一个实际应用：做的网站静态内容居多，但是多语言支持，网站的开发已经结束，是将语言存入客户端cookie中，然后通过cookie值获取对应资源文件。</p>
<p>现在需要对网站增加缓存。在asp.net 框架下,当然是首选 OutputCache。OutputCache是将客户端缓存以及服务端缓存进行统一管理，通过不同的策略设置。由于语言的更换不会修改URL，所以是无法使用浏览器缓存了（这里想起google以及很多网站在做多语言时都会把语言放入到URL中的好处了，可以充分利用浏览器缓存）。</p>
<p>网上查了些资料，比较零碎，这里进行一个整理。</p>
<p>首先：在web.config中定义缓存策略，</p>
<p>在web.config中的system.web下增加如下：</p>
<caching>

<pre><code>&lt;outputCacheSettings&gt;

  &lt;outputCacheProfiles&gt;

    &lt;add name=&quot;pageCache&quot; enabled=&quot;true&quot; duration=&quot;600&quot; varyByParam=&quot;none&quot; varyByCustom=&quot;LANG&quot; location=&quot;Server&quot; /&gt;

    &lt;add name=&quot;productCache&quot; enabled=&quot;true&quot; duration=&quot;600&quot; varyByParam=&quot;*&quot; varyByCustom=&quot;LANG&quot; location=&quot;Server&quot; /&gt;

  &lt;/outputCacheProfiles&gt;

&lt;/outputCacheSettings&gt;

&lt;outputCache enableOutputCache=&quot;true&quot;/&gt;</code></pre>   </caching>

<p>这里定义了两条策略，一条是不会根据参数更新缓存， 因为所有页面不需要传递参数，然后使用 varyByCustom=”LANG” 自定义缓存失效，location设置缓存存储位置，这里仅选择Server.另外一条，需要根据传递的参数更新缓存，所以设置 varyByParam=”*”。</p>
<p>然后关键的一步实现自定义缓存失效：需要在 Global.asax 中重写GetVaryByCustomString</p>
<p>public override string GetVaryByCustomString(HttpContext context, string custom)</p>
<pre><code>{

    return &quot;LANG=&quot; \+ context.Request.Cookies[&quot;PureWirelessEnt.Language&quot;][&quot;OverrideLanguage&quot;].ToString();

}</code></pre><p> 这里的custom就是 varyByCustom 值，框架会调用此方法判断是否有更新。如果定义了多个 varyByCustom的话，这里代码可以使用</p>
<p>switch(custom)</p>
<p>{</p>
<p>case “Lang”</p>
<p>…</p>
<p>}</p>
<p>分别管理缓存更新策略。我这里是获取cookie中的语言，如果语言改变时cookie改变，返回值也就改变，就会更新缓存。</p>
<p> 使用缓存策略，在aspx文件头部加入：</p>
<p>&lt;%@ OutputCache CacheProfile=”pageCache”%&gt;</p>
<p>即可。</p>
<p>方法很简单，但是很实用，另外，我判断是否缓存起效的方法是，启用调试，然后在页面的page_load中设置断点，然后浏览器中刷新页面，如果能获取断点，说明缓存失效，如果无法获取断点，说明浏览器为缓存中的内容。</p>
<p>本文技术含量不高，圈子里有位朋友自定义实现通过文件的方式进行缓存， 如有未说到之处，或者更好的解决方案，欢迎指正。</p>
<p><a href="http://blog.csdn.net/zhdd1234/article/details/7214408#" target="_blank" rel="noopener"></a></p>
<p><a href="http://blog.csdn.net/zhdd1234/article/details/7214408#" target="_blank" rel="noopener"></a></p>
<p><a href="http://blog.csdn.net/zhdd1234/article/details/7214408#" target="_blank" rel="noopener"></a></p>
<p><a href="http://blog.csdn.net/zhdd1234/article/details/7214408#" target="_blank" rel="noopener"></a></p>
<p><a href="http://blog.csdn.net/zhdd1234/article/details/7214408#" target="_blank" rel="noopener"></a></p>
<p><a href="http://blog.csdn.net/zhdd1234/article/details/7214408#" target="_blank" rel="noopener"></a></p>
<p><a href="http://www.csdn.net/app/" target="_blank" rel="noopener"></a></p>
<p><a href="http://www.csdn.net/app/" target="_blank" rel="noopener"></a></p>
<p><a href="http://blog.csdn.net/zhdd1234/article/details/" target="_blank" rel="noopener"></a></p>

  </div>
</article>



        
          <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </div>

    <div id="toc-footer" style="display: none">
      
    </div>

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/" target="_blank" rel="noopener"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&text=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&is_video=false&description=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET&body=Check out this article: http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/"><i class="fas fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&title=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&name=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=http://yoursite.com/2016/05/05/asp.net%E6%A0%B9%E6%8D%AECookie%E5%8F%98%E5%8C%96%E6%8E%A7%E5%88%B6%E7%BC%93%E5%AD%98-zhdd1234%E7%9A%84%E4%B8%93%E6%A0%8F-%E5%8D%9A%E5%AE%A2%E9%A2%91%E9%81%93-CSDN.NET/&t=asp.net根据Cookie变化控制缓存-zhdd1234的专栏-博客频道-CSDN.NET" target="_blank" rel="noopener"><i class="fab fa-hacker-news fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fas fa-bars fa-lg" aria-hidden="true"></i> Menu</a>
        <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fas fa-list fa-lg" aria-hidden="true"></i> TOC</a>
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> Share</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> Top</a>
    </div>

  </div>
</div>

        
        <footer id="footer">
  <div class="footer-left">
    Copyright &copy; 2020 Tmoonlight
  </div>
  <div class="footer-right">
    <nav>
      <ul>
         
          <li><a href="/">Home</a></li>
         
          <li><a href="/about/">About</a></li>
         
          <li><a href="/archives/">Writing</a></li>
         
          <li><a href="/projects_url">Projects</a></li>
        
      </ul>
    </nav>
  </div>
</footer>

    </div>
    <!-- styles -->

<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">


<link rel="stylesheet" href="/lib/justified-gallery/css/justifiedGallery.min.css">


    <!-- jquery -->

<script src="/lib/jquery/jquery.min.js"></script>


<script src="/lib/justified-gallery/js/jquery.justifiedGallery.min.js"></script>

<!-- clipboard -->

  
<script src="/lib/clipboard/clipboard.min.js"></script>

  <script type="text/javascript">
  $(function() {
    // copy-btn HTML
    var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"Copy to clipboard!\">";
    btn += '<i class="far fa-clone"></i>';
    btn += '</span>'; 
    // mount it!
    $(".highlight table").before(btn);
    var clip = new ClipboardJS('.btn-copy', {
      text: function(trigger) {
        return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str,it)=>str+it.innerText+'\n','')
      }
    });
    clip.on('success', function(e) {
      e.trigger.setAttribute('aria-label', "Copied!");
      e.clearSelection();
    })
  })
  </script>


<script src="/js/main.js"></script>

<!-- search -->

<!-- Google Analytics -->

<!-- Baidu Analytics -->

<!-- Disqus Comments -->


</body>
</html>
